.workflow-designer-page {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
}

.designer-toolbar {
  background: white;
  border-bottom: 1px solid #dee2e6;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  z-index: 100;
}

.toolbar-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.toolbar-center {
  display: flex;
  justify-content: center;
  flex: 2;
}

.toolbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
}

.designer-content {
  flex: 1;
  overflow: hidden;
}

// 专业设计器样式
.professional-designer {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.designer-layout {
  display: flex;
  width: 100%;
  height: calc(100vh - 80px);
}

// 左侧活动面板（专业模式）
.activity-panel {
  width: 380px;
  background: white;
  border-right: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;

    h6 {
      margin: 0;
      color: #495057;
      font-weight: 600;

      i {
        margin-right: 0.5rem;
        color: #0d6efd;
      }
    }
  }

  .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
  }
}

.workflow-info-compact {
  .form-label {
    margin-bottom: 0.25rem;
    font-weight: 500;
  }

  .form-control, .form-control-sm {
    border-radius: 4px;
    font-size: 0.875rem;
  }

  .form-check-label {
    color: #6c757d;
  }
}

.activity-categories {
  .category-section {
    margin-bottom: 1rem;
  }

  .category-header {
    padding: 0.5rem 0.75rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease;

    &:hover {
      background: #e9ecef;
    }

    i:first-child {
      margin-right: 0.5rem;
      color: #0d6efd;
    }
  }

  .activity-item-compact {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin: 0.25rem 0;
    border: 1px solid #e9ecef;
    border-left: 3px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;

    &:hover {
      border-color: #0d6efd;
      background-color: #f8f9ff;
      transform: translateX(2px);
    }
  }

  .activity-icon-small {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.5rem;
    font-size: 0.875rem;
  }

  .activity-info-small {
    flex: 1;
    min-width: 0;
  }

  .activity-name-small {
    font-size: 0.8rem;
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.125rem;
  }

  .activity-desc-small {
    font-size: 0.7rem;
    color: #6c757d;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

// 中间画布面板
.canvas-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fafafa;
}

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid #e9ecef;

  .canvas-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .canvas-controls {
    font-size: 0.875rem;
  }
}

.canvas-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.workflow-canvas-pro {
  display: block;
  background: white;
  border: 1px solid #e9ecef;
  cursor: crosshair;

  &:hover {
    background: #fdfdfd;
  }
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  z-index: 10;

  .overlay-content {
    text-align: center;
  }
}

// 右侧属性面板
.properties-panel {
  width: 320px;
  background: white;
  border-left: 1px solid #e9ecef;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  .panel-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;

    h6 {
      margin: 0;
      color: #495057;
      font-weight: 600;

      i {
        margin-right: 0.5rem;
        color: #0d6efd;
      }
    }
  }

  .panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
  }
}

.node-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;

  .node-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
  }

  .node-info {
    flex: 1;

    h6 {
      margin: 0;
      color: #212529;
    }

    small {
      line-height: 1.3;
    }
  }
}

.property-section {
  margin-bottom: 1.5rem;

  h6 {
    color: #495057;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;

    i {
      margin-right: 0.5rem;
      color: #0d6efd;
    }
  }

  .form-label {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
    color: #495057;
  }
}

.property-item-pro {
  .form-control, .form-select {
    font-size: 0.875rem;
    border-radius: 4px;
  }

  .form-text {
    font-size: 0.75rem;
    margin-top: 0.25rem;
  }
}

.connection-list {
  .connection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    margin-bottom: 0.25rem;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 0.875rem;
  }
}

.no-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
}

.loading-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.error-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

/* 简单设计器样式（保持原有样式） */
.simple-designer {
  .activity-panel {
    background: white;
    border-right: 1px solid #e9ecef;
    height: calc(100vh - 80px);
    overflow-y: auto;

    .panel-content {
      padding: 1.5rem;
    }

    .panel-title {
      color: #495057;
      margin-bottom: 0.5rem;
      font-weight: 600;
    }

    .activity-list {
      margin-top: 1rem;
    }

    .activity-item {
      display: flex;
      align-items: center;
      padding: 0.75rem;
      margin-bottom: 0.5rem;
      border: 1px solid #e9ecef;
      border-radius: 8px;
      cursor: pointer;
      transition: all 0.2s ease;
      background: white;

      &:hover {
        border-color: #0d6efd;
        background-color: #f8f9ff;
        transform: translateY(-1px);
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
      }
    }

    .activity-icon {
      width: 40px;
      height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
      background-color: #f8f9fa;
      border-radius: 8px;
      margin-right: 0.75rem;
      color: #6c757d;
      font-size: 1.25rem;
    }

    .activity-info {
      flex: 1;
    }

    .activity-name {
      font-weight: 500;
      color: #212529;
      margin-bottom: 0.25rem;
    }

    .activity-description {
      font-size: 0.875rem;
      color: #6c757d;
      line-height: 1.3;
    }

    .activity-add {
      color: #28a745;
      font-size: 1.25rem;
    }

    /* 工作流画布样式 */
    .workflow-canvas {
      background: #fafafa;
      height: calc(100vh - 80px);
      overflow-y: auto;
    }

    .canvas-content {
      padding: 1.5rem;
    }

    .workflow-info {
      background: white;
      padding: 1.5rem;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }

    .workflow-steps {
      background: white;
      padding: 1.5rem;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      min-height: 400px;
    }

    .steps-container {
      position: relative;
    }

    .step-node {
      position: relative;
      margin-bottom: 1rem;
      padding: 1rem;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.1);
      transition: all 0.2s ease;

      &.start-node {
        background: linear-gradient(135deg, #28a745, #20c997);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        
        i {
          margin-right: 0.5rem;
          font-size: 1.25rem;
        }
      }

      &.end-node {
        background: linear-gradient(135deg, #dc3545, #fd7e14);
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        
        i {
          margin-right: 0.5rem;
          font-size: 1.25rem;
        }
      }

      &.activity-node {
        background: white;
        border: 2px solid #e9ecef;

        &:hover {
          border-color: #0d6efd;
          transform: translateY(-2px);
          box-shadow: 0 4px 16px rgba(13, 110, 253, 0.15);
        }
      }
    }

    .step-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 1rem;
    }

    .step-info {
      display: flex;
      align-items: center;
      
      i {
        margin-right: 0.5rem;
        color: #0d6efd;
        font-size: 1.25rem;
      }
    }

    .step-name {
      font-weight: 600;
      color: #212529;
    }

    .step-actions {
      display: flex;
      gap: 0.25rem;
      
      .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        
        &:disabled {
          opacity: 0.5;
        }
      }
    }

    .step-properties {
      margin-top: 1rem;
      padding-top: 1rem;
      border-top: 1px solid #e9ecef;
    }

    .property-item {
      margin-bottom: 0.75rem;
      
      .form-label {
        margin-bottom: 0.25rem;
        font-weight: 500;
        color: #495057;
      }
    }

    .step-connector {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 0.5rem 0;
      position: relative;
    }

    .connector-line {
      width: 2px;
      height: 20px;
      background-color: #6c757d;
    }

    .connector-arrow {
      color: #6c757d;
      font-size: 1.25rem;
      margin-top: -2px;
    }

    .no-steps {
      min-height: 300px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
    }

    /* 帮助面板样式 */
    .help-panel {
      background: white;
      border-left: 1px solid #e9ecef;
      height: calc(100vh - 80px);
      overflow-y: auto;

      .panel-content {
        padding: 1.5rem;
      }

      .panel-title {
        color: #495057;
        margin-bottom: 0.5rem;
        font-weight: 600;
      }

      .help-sections {
        margin-top: 1rem;
      }

      .help-section {
        margin-bottom: 2rem;
        
        h6 {
          color: #495057;
          margin-bottom: 0.75rem;
          font-weight: 600;
          
          i {
            margin-right: 0.5rem;
            color: #0d6efd;
          }
        }
      }

      .help-list {
        padding-left: 1.25rem;
        margin-bottom: 0;
        
        li {
          margin-bottom: 0.5rem;
          color: #6c757d;
          font-size: 0.875rem;
        }
      }

      .activity-help {
        margin-bottom: 1rem;
        padding: 0.75rem;
        background-color: #f8f9fa;
        border-radius: 6px;
        
        strong {
          color: #495057;
          font-size: 0.875rem;
        }
        
        p {
          margin-bottom: 0;
        }
      }
    }
  }
}

/* 按钮样式 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  transition: all 0.2s ease;
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }
}

.btn-toolbar {
  .btn-group {
    .btn {
      padding: 0.375rem 0.75rem;
      font-size: 0.875rem;
    }
  }
}

.btn-outline-secondary {
  color: #6c757d;
  border-color: #6c757d;
  
  &:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: white;
  }
}

.btn-outline-info {
  color: #0dcaf0;
  border-color: #0dcaf0;
  
  &:hover {
    background-color: #0dcaf0;
    border-color: #0dcaf0;
    color: white;
  }
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
  
  &:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
  }
}

.btn-success {
  background-color: #198754;
  border-color: #198754;
  
  &:hover {
    background-color: #157347;
    border-color: #146c43;
  }
}

/* 表单样式 */
.form-control,
.form-select {
  border-radius: 6px;
  border: 1px solid #ced4da;
  transition: all 0.2s ease;
  
  &:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  }
}

.form-check-input {
  &:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
  }
  
  &:focus {
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .designer-layout {
    .activity-panel {
      width: 320px;
    }
    
    .properties-panel {
      width: 280px;
    }
  }
}

@media (max-width: 992px) {
  .designer-layout {
    flex-direction: column;
    
    .activity-panel,
    .properties-panel {
      width: 100%;
      height: 200px;
      border: none;
      border-bottom: 1px solid #e9ecef;
    }
    
    .canvas-panel {
      flex: 1;
      min-height: 400px;
    }
  }
  
  .toolbar-center {
    display: none;
  }
  
  .designer-toolbar {
    flex-direction: column;
    gap: 1rem;
    
    .toolbar-left,
    .toolbar-right {
      width: 100%;
      justify-content: center;
    }
  }
  
  .toolbar-left h2 {
    margin: 0 !important;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .simple-designer {
    .canvas-content {
      padding: 1rem;
    }
    
    .panel-content {
      padding: 1rem;
    }
    
    .activity-item {
      flex-direction: column;
      text-align: center;
      
      .activity-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
      }
      
      .activity-add {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
      }
    }
    
    .step-header {
      flex-direction: column;
      gap: 0.5rem;
      align-items: flex-start;
    }
    
    .step-actions {
      align-self: stretch;
      justify-content: space-between;
    }
  }
}
